package ext.vpde.cadvaulting.globalvault;

import wt.epm.EPMDocument;
import java.util.*;

import ext.vpde.cadvaulting.util.SJTCSQL;

public class GlobalVault {
	public static boolean getPDF(EPMDocument drw) throws Exception {
		boolean getOk = false;
		Hashtable ht = new Hashtable();
		String pdfId = drw.getPersistInfo().getObjectIdentifier().getStringValue();
		pdfId = pdfId.substring(pdfId.lastIndexOf(":")+1);
		ht.put("PDF_ID",pdfId);
		ht.put("FILE_ID",drw.getNumber());
		ht.put("REVISION_LEVEL", drw.getVersionIdentifier().getValue());
		ht.put("PDF_FILE_TITLE", drw.getName());
		ht.put("SOURCE", SJTCSQL.getDocumentSource(pdfId));
		ht.put("FILENAME", drw.getCADName());
		ht.put("FILESIZE", SJTCSQL.getFileSize(pdfId));
		getOk = SJTCSQL.sendPDF(ht);
		return getOk;
	}
}
